# -*- coding:utf-8 -*-
"""
接口变量类
全局变量存库：需要查找对应项目下的变量

"""


class interfaceGlobalsEnv:

    def __init__(self, project_id):
        # 项目ID
        self.project_id = project_id

    def set(self, variable, value=None):
        """
        设置全局变量,全局变量需要存库，所以需要将类型也存进去，读取出来后，直接转化成对应类型的数据
        :param variable:变量名
        """
        pass

    def get(self, variable):
        """
        获取全局变量
        :param variable:变量名
        """
        pass

    def delete(self, variable):
        """
        删除全局变量
        :param variable:变量名
        """
        pass


class interfaceEnv:
    def __init__(self, project_id):
        self.globals = interfaceGlobalsEnv(project_id)
        self.variable = {}

    def set(self, variable, value=None):
        """
        设置变量
        :param variable:变量名
        :param value:存的值
        """
        self.variable[variable] = value

    def get(self, variable):
        """
        获取变量
        :param variable:变量名
        """
        return self.variable[variable]

    def delete(self, variable):
        """
        删除变量
        :param variable:变量名
        """
        self.variable.pop(variable)
